home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Info / miff.format < prev    next >
Encoding:
Text File  |  1991-03-13  |  6.5 KB  |  152 lines  |  [TEXT/UNIX]

  1. .ad l
  2. .nh
  3. .TH MIFF 5 "1 January 1991" "X Version 11"
  4. .SH "MIFF FILE FORMAT"
  5. .PP
  6. The Machine Independent File Format is described in this section.
  7. .PP
  8. A MIFF image file consist of two sections.  The first section is
  9. composed of keywords describing the image in text form.  The next
  10. section is the binary image data.  The two sections are separated by a
  11. \fB:\fP character immediately followed by a \fInewline\fP.  Generally,
  12. the first section has a \fIform-feed\fP and \fInewline\fP proceeding
  13. the \fB:\fP character.   You can then list the image keywords with
  14. \fImore\fP, without printing the binary image that follows the \fB:\fP
  15. separator.
  16. .PP
  17. Each keyword must be separated by at least one space but can be
  18. separated with control characters such a \fIform-feed\fP or
  19. \fInewline\fP.
  20. .PP
  21. A list of valid keywords follows:
  22. .TP 5
  23. .B "class=\fIDirectClass | PseudoClass\fP"
  24. identifies the type of binary image stored within the file.  
  25.  
  26. This keyword is optional.  If it is not specified, a \fIDirectClass\fP
  27. image format is assumed.  An explanation of \fIDirectClass\fP and
  28. \fIPseudoClass\fP image data follows this list.
  29. .TP 5
  30. .B "colors=\fIvalue\fP"
  31. specifies the number of colors in the image, and for pseudo-color
  32. images the size of the colormap.  
  33.  
  34. This keyword is optional.  However, if a colormap size is not
  35. specified, a linear colormap is assumed for pseudo-color images.
  36. .TP 5
  37. .B "columns=\fIvalue\fP"
  38. is a required keyword and specifies the number of columns, or width in
  39. pixels, of the image.
  40. .TP 5
  41. .B "compression=\fIQEncoded | RunlengthEncoded\fP"
  42. identifies how the image stored within the file is compressed.
  43.  
  44. This keyword is optional.  If it is not specified, the image is assumed
  45. to be uncompressed.  A detailed explanation of runlength-encoded and
  46. Q-coder image compression follows this list.
  47. .TP 5
  48. .B "id=\fIImageMagick\fP"
  49. is a required keyword and identifies this file as a MIFF image.  
  50. .TP 5
  51. .B "packets=\fIvalue\fP"
  52. specifies the number of compressed color packets in the image data section.  
  53.  
  54. This keyword is optional, but recommended, for runlength-encoded image
  55. compression.  It is required for Q-encoded image compression.  A
  56. detailed explanation of image compression follows this list.
  57. .TP 5
  58. .B "rows=\fIvalue\fP"
  59. is a required keyword and specifies the number of rows, or height in pixels, 
  60. of the image.
  61. .TP 5
  62. .B "scene=\fIvalue\fP"
  63. is an optional keyword and is a reference number for sequencing of
  64. images.  
  65.  
  66. This keyword is typically useful for animating a sequence of images.
  67. .PP
  68. Comments can be included in the keyword section.  Comments must begin with
  69. a \fB{\fP character and end with a \fI}\fP character.  
  70. .PP
  71. An example keyword section follows:
  72. .PP
  73.     {
  74.       Rendered via Dore by Sandy Hause.
  75.     }
  76.     id=ImageMagick
  77.     class=PseudoClass  colors=256
  78.     compression=RunlengthEncoded  packets=27601
  79.     columns=1280  rows=1024
  80.     scene=1
  81.     ^L
  82.     :
  83. .PP
  84. The binary image data that follows the keyword text is stored in one of 
  85. two binary classes as specified by the \fBclass\fP keyword: 
  86. \fIDirectClass\fP or \fIPseudoClass\fP.
  87. .PP
  88. Use the \fIDirectClass\fP class to store continuous-tone images.
  89. \fIDirectClass\fP requires that the image pixels immediately follow the
  90. keyword text and be stored as binary red, green, and blue intensity
  91. values.  The total number of pixels expected is equal to the number of pixel 
  92. columns times the number of pixel rows as specified by the \fBcolumns\fP and 
  93. \fBrows\fP keywords.
  94. .PP
  95. If the \fBcompression\fP keyword is not specified, a red, green, and blue byte 
  96. in that order is expected for each pixel of the image.
  97. .PP
  98. If \fBcompression\fP is \fIQEncoded\fP, each red, green, and blue byte
  99. intensity value is encoded using the Q-coder compression algorithm.
  100. Use the \fBpackets\fP keyword to specify the total number of Q-encoded
  101. packets that comprise the image.  Refer to "Sofware implementations of
  102. the Q-Coder", by Mitchell, J. L. and Pennebaker, W.B. (IBM Journal Res.
  103. Development, Volume 32, Number 6, November 1988, pages 753 - 774) for
  104. implementation specific details.
  105. .PP
  106. If \fBcompression\fP is \fIRunlengthEncoded\fP, each red, green, and
  107. blue byte intensity value is followed by a count byte. This value
  108. specifies the number of horizonally contiguous pixels in the image of
  109. that color.  The count (0-255) is one less than the actual number of
  110. contiguous pixels; thus a single packet can represent from 1 up to 256
  111. identical pixels.  The total number of pixels specified by the
  112. individual count bytes must add up to the number of pixel columns times
  113. the number of pixel rows as specified by the \fBcolumns\fP and
  114. \fBrows\fP keywords.  Use \fBpackets\fP to specify the total number of
  115. runlength-encoded packets that comprise the image.
  116. .PP
  117. Use the \fIPseudoClass\fP class to store pseudo-color images.
  118. \fIPseudoClass\fP requires that the image colormap and
  119. pseudo-color pixels immediately follow the keyword text.  The colormap
  120. is stored as contiguous red, green, and blue intensity values.  The
  121. number of intensity values expected is determined by the \fBcolors\fP
  122. keyword.  Note, an image colormap is restricted to at most 65535
  123. entries.  The binary pseudo-color image is stored as indexes into the
  124. colormap.  If the colormap size exceeds 256 entries, then each colormap
  125. index is two bytes each with the most-significant-byte first.  The
  126. total number of pixels expected is equal to the number of pixel columns
  127. times the number of pixel rows as specified by the \fBcolumns\fP and
  128. \fBrows\fP keywords.
  129. .PP
  130. If the \fBcompression\fP keyword is not specified, a colormap index is 
  131. expected for each pixel of the image.
  132. .PP
  133. If \fBcompression\fP is \fIQEncoded\fP, each colormap index is
  134. encoded using the Q-coder compression algorithm.  Use the \fBpackets\fP
  135. keyword to specify the total number of Q-encoded packets comprise the
  136. image.  Refer to "Sofware implementations of the Q-Coder", by Mitchell,
  137. J. L. and Pennebaker, W.B. (IBM Journal Res. Development, Volume 32,
  138. Number 6, November 1988, pages 753 - 774) for implementation specific
  139. details.
  140. .PP
  141. If \fBcompression\fP is \fIRunlengthEncoded\fP, each colormap index
  142. is followed by a count byte. This value  specifies the number of
  143. horizonally contiguous pixels in the image of that color.  The count
  144. (0-255) is one less than the actual number of contiguous pixels; thus a
  145. single packet can represent from 1 up to 256 identical pixels.  The
  146. total number of pixels specified by the individual count bytes must add
  147. up to the number of pixels expected in the image as specified by the
  148. \fBcolumns\fP and \fBrows\fP keywords.  Use \fBpackets\fP to specify the 
  149. total number of runlength-encoded packets that comprise the image.
  150.  
  151.  
  152.